package org.cainiao.basic.string;

/**
 * <br />
 * <p>
 * Author: Cai Niao(wdhlzd@163.com)<br />
 */
public class StringTest {

    public static void main(String[] args) {
        f();
    }

    public static void f() {
        String str1 = "Hello";
        String strObject1 = new String("Hello");
        String strObject2 = new String("Hello");

        String str2 = strObject1.intern();

        System.out.println("str1 == strObject1: " + (str1 == strObject1)); // false
        System.out.println("str1 == str2: " + (str1 == str2)); // true
        System.out.println("str2 == strObject1: " + (str2 == strObject1)); // false
        System.out.println("strObject1 == strObject2: " + (strObject1 == strObject2)); // false
    }
}
